<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">

	<ui:define name="content">
		<div>
			<h:form>

				<h:commandButton value="Szukaj książek"
					disabled="#{userBean.currentTab == 'browse'}">
					<f:setPropertyActionListener target="#{userBean.currentTab}"
						value="browse" />
				</h:commandButton>
				<h:commandButton value="Stwórz"
					disabled="#{userBean.currentTab == 'create'}">
					<f:setPropertyActionListener target="#{userBean.currentTab}"
						value="create" />
				</h:commandButton>
				<h:commandButton value="Dołącz"
					disabled="#{userBean.currentTab == 'join'}">
					<f:setPropertyActionListener target="#{userBean.currentTab}"
						value="join" />
				</h:commandButton>
				<h:commandButton value="Opuść"
					disabled="#{userBean.currentTab == 'leave'}">
					<f:setPropertyActionListener target="#{userBean.currentTab}"
						value="leave" />
				</h:commandButton>

				<h:commandButton value="Dodaj książke"
					disabled="#{userBean.currentTab == 'add'}">
					<f:setPropertyActionListener target="#{userBean.currentTab}"
						value="add" />
				</h:commandButton>
				<br />
			</h:form>
		</div>

		<div id="menu">
			<c:if test="#{userBean.currentTab == 'create'}">

				<ui:include src="createRepo.xhtml" />

			</c:if>

			<c:if test="#{userBean.currentTab == 'browse'}">
				<ui:include src="repository.xhtml" />
			</c:if>

			<c:if test="#{userBean.currentTab == 'join'}">
				<ui:include src="joinRepo.xhtml" />
			</c:if>

			<c:if test="#{userBean.currentTab == 'leave'}">
				<ui:include src="leaveRepo.xhtml" />
			</c:if>

			<c:if test="#{userBean.currentTab == 'add'}">
				<ui:include src="bookSearch.xhtml" />
			</c:if>

		</div>

	</ui:define>

</ui:composition>
</html>